package com.risetechnology.services;

import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

import com.risetechnology.krystalkitchen1.DialogReminder;

public class AlertService extends Service {

	private boolean bootup = false;
	private PendingIntent pi;

	@Override
	public void onCreate() {
		
	}
	
	@Override
	public IBinder onBind(Intent intent) {
		
		return null;
	}

	@Override
	public void onDestroy() {
	}

	@Override
	public void onStart(Intent intent, int startId) {
		// TODO Auto-generated method stub
		super.onStart(intent, startId);
		if(null == intent) return;
		
		String name = intent.getStringExtra("SCHEDULE_NAME");
		String time = intent.getStringExtra("SCHEDULE_TIME");
		if(null != name && null != time){
			Intent myIntent = new Intent(getBaseContext(), DialogReminder.class);
			myIntent.putExtra("SCHEDULE_NAME", name);
			myIntent.putExtra("SCHEDULE_TIME", time);
	    	myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
	    	myIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
	    	
			startActivity(myIntent);
		}
	}
	
	@Override
	public boolean onUnbind(Intent intent) {
		return super.onUnbind(intent);
	}

}